//企业管理-企业员工-配置文件
App.util.ns('Admin.Enterprise.Personnel');
Admin.Enterprise.Personnel.Conf = {
    columns: [
        {name: '员工名称', value: 'name'},
        {name: '企业名称', width: '150px', value: function(item){
            return item.enterprise ? item.enterprise.name : '-- --';
        }},
        {name: '性别', width: '100px', value: function(item){
            switch (item.gender+'') {
                case '0':
                    return '未知';
                case '1':
                    return '男';
                case '2':
                    return '女';
            }
        }},
        {name: '手机号', width: '100px',value: 'phone'},
        {name: '创建日期', width: '80px', value: function(item){
            return App.util.formator.date(item.created_at);
        }}
    ],
    form: [
        {type: 'hidden', name: 'id'},
        {type: 'input', name: 'name', title: '员工名称', required: true, maxLength: 40, rule: {
            type: 'str',
            range: [1, 40]
        }},
        {type: 'radio', name: 'gender', title: '性别',
            items: [
                ['0', '未知'],
                ['1', '男'],
                ['2', '女']
            ],
            defaults: '0'
        },
        {type: 'input', name: 'phone', title: '手机号', rule: {
            type: 'str',
            range: [0, 40]
        }}
    ]
};